/*
 * @Author: your name
 * @Date: 2021-10-11 18:51:58
 * @LastEditTime: 2021-10-11 19:13:21
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \luogu\1.5贪心\P1223\main.cpp
 */
#include<iostream>
using namespace std;
#include<iomanip>
#include<stdlib.h>
#include<time.h>

const int MAX = 1000;

void quickSort(int a[],int low,int high);
int main(){
    int n,a[MAX];
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    //排序
    quickSort(a,0,n-1);
    //计算平均时间
    double sum = 0;
    for(int i=0; i<n-1; i++){
        // cout << a[i] << " ";
        sum += (n-i-1)*a[i];
        // cout << n-i-1 << "people wait for " << a[i] << endl;
    }
    cout << fixed << setprecision(2) << sum/n << endl;

    return 0;
}

void quickSort(int a[],int low,int high)
{
    if(low < high){
        srand(time(NULL));
        int tem = rand()%(high-low+1)+low;
        int pivot = a[tem];
        a[tem] = a[low];
        a[low] = pivot;

        int l = low;
        int r = high;

        while(l < r){
            while(l < r && a[r] > pivot) r--;
            if(l < r) a[l++] = a[r];
            while(l < r && a[l] < pivot) l++;
            if(l < r) a[r--] = a[l];
        }
        a[l] = pivot; 
        quickSort(a,low,l-1);
        quickSort(a,l+1,high);
    }
}